package sy.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
 * 
 * @author ray
 * 科目表
 */
@Entity
@Table(name = "TACCOUNT", schema = "")
@DynamicUpdate(true)
@DynamicInsert(true)
public class Taccount implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String id;
	//科目编码
	private String accNo;
	//科目名称
	private String accName;
	//科目描述
	private String description;
	
	private Set<TOrderCash> orderCashs =new HashSet<TOrderCash>(0);
	
	@Id
	@Column(name = "ID", nullable = false, length = 36)
	public String getId() {
		return id;
	}

	public Taccount setId(String id) {
		this.id = id;
		return this;
	}
	@Column(name = "ACCNO", unique = true,length = 20)
	public String getAccNo() {
		return accNo;
	}

	public Taccount setAccNo(String accNo) {
		this.accNo = accNo;
		return this;
	}
	@Column(name = "ACCNAME", unique = true,length = 20)
	public String getAccName() {
		return accName;
	}
	
	public Taccount setAccName(String accName) {
		this.accName = accName;
		return this;
	}
	@Column(name = "DESCRIPTION",length = 20)
	public String getDescription() {
		return description;
	}

	public Taccount setDescription(String description) {
		this.description = description;
		return this;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "taccount")
	public Set<TOrderCash> getOrderCashs() {
		return orderCashs;
	}

	public void setOrderCashs(Set<TOrderCash> orderCashs) {
		this.orderCashs = orderCashs;
	}

}
